$(function(){
	//获取下方切换按钮数组
	let btn2 = $(".IQ-switch>div")
	
	//无色小图标
	arryA=["./img/ic_home_A_s2x.png","./img/ic_scene_A_2x.png","./img/ic_mal_A_2x.png","./img/ic_mine_A_n2x.png"]

	//有色小图标
	arryB=["./img/ic_home_B_s2x.png","./img/ic_scene_B_2x.png","./img/ic_mal_B_2x.png","./img/ic_mine_B_n2x.png"]

	//页面div元素数组
	arryC=[$(".IQ-MyHome-app"),$(".IQ-Scene-app"),{},$(".IQ-MyPage-app")]

	//给下方切换加onclick事件
	$(btn2).on("click",function(){
		//循环拜btn2的按钮数组
		for(let i=0;i<btn2.length;i++){
			//如果按钮下标和获取的自定义index属性相同
			if(i == $(this).data("index")){
				//将图片地址改为有色图片
				$(btn2[i]).children("div").children("img").prop("src",arryB[i])
				//图片下方字体改颜色
				$(btn2[i]).children("span").css("color","#56A894")
				//给div元素数组对应下标的div设置display样式
				$(arryC[i]).css("display","flex")
				//如果是我的页面则将下方按钮背景颜色修改
				if(i==3){
					$(".IQ-switch").css("background-color","#F0F1F5")
				}else{
					$(".IQ-switch").css("background-color","white")
				}
				//如果不是对应的自定义index则将页面隐藏并且修改字体颜色
			}else{
				$(btn2[i]).children("div").children("img").prop("src",arryA[i])
				$(btn2[i]).children("span").css("color","#5C5E5E")
				$(arryC[i]).css("display","none")
			}
		}
	})
})